package com.ruoyi.User.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.User.mapper.UserMapper;
import com.ruoyi.User.domain.User;
import com.ruoyi.User.service.IUserService;
import com.ruoyi.common.core.text.Convert;

/**
 * 用户 服务层实现
 * 
 * @author ruoyi
 * @date 2019-07-25
 */
@Service
public class UserServiceImpl implements IUserService 
{
	@Autowired
	private UserMapper userMapper;

	/**
     * 查询用户信息
     * 
     * @param id 用户ID
     * @return 用户信息
     */
    @Override
	public User selectUserById(Integer id)
	{
	    return userMapper.selectUserById(id);
	}
	
	/**
     * 查询用户列表
     * 
     * @param user 用户信息
     * @return 用户集合
     */
	@Override
	public List<User> selectUserList(User user)
	{
	    return userMapper.selectUserList(user);
	}
	
    /**
     * 新增用户
     * 
     * @param user 用户信息
     * @return 结果
     */
	@Override
	public int insertUser(User user)
	{
	    return userMapper.insertUser(user);
	}
	
	/**
     * 修改用户
     * 
     * @param user 用户信息
     * @return 结果
     */
	@Override
	public int updateUser(User user)
	{
	    return userMapper.updateUser(user);
	}

	/**
     * 删除用户对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteUserByIds(String ids)
	{
		return userMapper.deleteUserByIds(Convert.toStrArray(ids));
	}

	@Override
	public List<User> selectChiefList(Integer id) {
		return userMapper.selectChiefList(id);
	}

	@Override
	public int selectUserCountForEchart(String days) {
		// TODO Auto-generated method stub
		return userMapper.selectUserCountForEchart(days);
	}

	@Override
	public int selectRiderUserCountForEchart(String days) {
		return userMapper.selectRiderUserCountForEchart(days);
	}

	@Override
	public int selectUserCountForEchartMonth(String month) {
		return userMapper.selectUserCountForEchartMonth(month);
	}

	@Override
	public int selectRiderUserCountForEchartMonth(String month) {
		return userMapper.selectRiderUserCountForEchartMonth(month);
	}

	@Override
	public List<Map<String, Object>> selectUserCountForInformationMonth(
			int flag, String createDate) {
		return userMapper.selectUserCountForInformationMonth(flag,createDate);
	}

	@Override
	public List<Map<String, Object>> selectUserCountForInformationYear(
			int flag, String year) {
		return userMapper.selectUserCountForInformationYear(flag,year);
	}

	@Override
	public int selectRiderVerifyCount() {
		return userMapper.selectRiderVerifyCount();
	}

	@Override
	public List<User> selectRiderListForSchool(User user) {
		// TODO Auto-generated method stub
		return userMapper.selectRiderListForSchool(user);
	}
	
}
